#Custom Loader
file(GLOB CUSTOM_LOADER_SOURCES CustomLoader.*)
include_directories (${YAST_INCLUDE_DIR})


add_library(loader SHARED ${CUSTOM_LOADER_SOURCES})

message ("using ${YAST_PLUGIN_WFM_LIBRARY}")
add_executable(testLoader ${CUSTOM_LOADER_SOURCES})
target_link_libraries(testLoader ${YAST_YCP_LIBRARY})
target_link_libraries(testLoader ${YAST_LIBRARY})

#"/usr/lib/YaST2/plugin/"
# use, i.e. don't skip the full RPATH for the build tree
SET(CMAKE_SKIP_BUILD_RPATH  FALSE)

# when building, don't use the install RPATH already
# (but later on when installing)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) 

# the RPATH to be used when installing
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib/YaST2/plugin")

# add the automatically determined parts of the RPATH
# which point to directories outside the build tree to the install RPATH
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)


target_link_libraries(testLoader "/usr/lib/YaST2/plugin/libpy2wfm.so.2")


